import Layout from '@/layout'
import Empty from '@/components/Empty'

const tenantLayout = {
  path: '/manage',
  component: Layout,
  name: 'manage',
  redirect: '/manage/manage-org',
  isUpload: false,
  meta: {
    title: '授权管理',
    icon: 'rbac-org'
  },
  children: []
}

const tenantRoutes = [
  {
    path: 'manage-account',
    component: () => import('@/views/admin-manage/manage/account'),
    name: 'AccountManage',
    meta: {
      title: '账套管理'
    }
  },
  {
    path: 'ui-scan',
    component: () => import('@/views/admin-manage/manage/ui/scan'),
    name: 'UiScan',
    meta: {
      title: '资源扫描'
    }
  }
]

const accountRoutes = [
  {
    path: 'manage-org',
    component: () => import('@/views/admin-manage/manage/org'),
    name: 'OrgManager',
    meta: {
      title: '机构管理'
    }
  },
  {
    path: 'manage-role',
    component: () => import('@/views/admin-manage/manage/role'),
    name: 'UserManageRole',
    meta: {
      title: '角色管理'
    }
  },
  {
    path: 'manage-user',
    component: () => import('@/views/admin-manage/manage/user'),
    name: 'UserManager',
    meta: {
      title: '用户管理'
    }
  },
  {
    path: 'api-manager',
    component: Empty,
    name: 'Empty',
    meta: {
      title: 'API授权管理'
    },
    children: [
      {
        path: 'rbac-user-org',
        component: () => import('@/views/admin-manage/rbac/rbac-user-org'),
        name: 'RbacUserOrg',
        meta: {
          title: '用户/机构授权'
        }
      },
      {
        path: 'rbac-role',
        component: () => import('@/views/admin-manage/rbac/rbac-role'),
        name: 'RbacRoles',
        meta: {
          title: '角色授权管理'
        }
      },
      {
        path: 'rbac-method',
        component: () => import('@/views/admin-manage/rbac/rbac-method'),
        name: 'RbacMethod',
        meta: {
          title: '方法授权管理'
        }
      }
    ]
  },
  {
    path: 'ui-manager',
    component: Empty,
    name: 'Empty',
    meta: {
      title: 'UI授权管理'
    },
    children: [
      {
        path: 'ui-permission',
        component: () => import('@/views/admin-manage/manage/ui/permission'),
        name: 'UiPermission',
        meta: {
          title: '资源授权'
        }
      },
      {
        path: 'ui-permission-org-user',
        component: () => import('@/views/admin-manage/manage/ui/org-user-ui'),
        name: 'UiOrgUserPermission',
        meta: {
          title: '机构人员资源授权'
        }
      }
    ]
  }
]

export {
  tenantLayout,
  tenantRoutes,
  accountRoutes
}
